package com.struts2learning.action;

import java.util.ArrayList;
import java.util.List;

import com.struts2learning.bean.Book;

public class BookAction {
	public static List<Book> bookList=new ArrayList<Book>();
	private String title;
	private Book book;
	public String initAdd(){
		return "initAdd";
	}
	public String Add(){
		bookList.add(book);
		title="<br/><br/>添加书籍成功<br/><br/>";
		return "success";
	}
	
	public String list(){
		return "list";
	}
	public String clear(){
		bookList.clear();
		title="<br/><br/>清空书籍列表成功<br/><br/>";
		return "list";
	}
	public List<Book> getBookList() {
		return bookList;
	}
	public void setBookList(List<Book> bookList) {
		BookAction.bookList = bookList;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public Book getBook() {
		return book;
	}
	public void setBook(Book book) {
		this.book = book;
	}
	

}
